package com.aramco.fion.vo
{
	import com.aramco.fion.model.FlexConstants;
	import com.aramco.fion.util.AdminUtil;
	
	import flash.utils.describeType;
	import flash.utils.getQualifiedClassName;
	
	import mx.collections.ArrayCollection;
	

	public class ComponentAssignmentVO
	{
		public function ComponentAssignmentVO(viewId:String,compId:String,zorder:String)
		{
			this.viewId = viewId;
			this.compId = compId;
			this.zorder = zorder;
			
			createdOn = new dateVO("");
			changedOn = new dateVO("");

		}
		
		
		public var viewId:String  = "";
		public var compId:String = "";
		public var zorder:String = "";
		
		public var createdBy:String = "";
		public var createdOn:dateVO ;
		public var changedBy:String = "";
		public var changedOn:dateVO;
		
		public function toXML():XML
			
		{	
			var rowXML:XML = new XML('<row/>');
			var dataXML:XML;

				dataXML = new XML('<data/>');
				
				// View ID
				dataXML.@name =  AdminUtil.viewTableFields[0];
				dataXML.@value = viewId;
				rowXML.appendChild(dataXML);
				
				
				// Component ID
				dataXML = new XML('<data/>');
				dataXML.@name =  AdminUtil.compTableFields[0];
				dataXML.@value = compId;
				rowXML.appendChild(dataXML);
				
				// Component order in view
				dataXML = new XML('<data/>');
				dataXML.@name =  AdminUtil.viewTableFields[12];
				dataXML.@value = zorder;
				rowXML.appendChild(dataXML);
				
				
				
				// Created by
				dataXML = new XML('<data/>');
				dataXML.@name =  AdminUtil.compTableFields[6];
				dataXML.@value = createdBy.toString();
				rowXML.appendChild(dataXML);
				
				// Created on
				dataXML = new XML('<data/>');
				dataXML.@name =  AdminUtil.compTableFields[7];
				dataXML.@value = "";
				rowXML.appendChild(dataXML);
				
				// Last Changed by User
				dataXML = new XML('<data/>');
				dataXML.@name =  AdminUtil.compTableFields[8];
				dataXML.@value = changedBy.toString();
				rowXML.appendChild(dataXML);
				
				// Changed On 
				dataXML = new XML('<data/>');
				dataXML.@name =  AdminUtil.compTableFields[9];
				dataXML.@value = "";
				rowXML.appendChild(dataXML);
				
			return rowXML; 

		}
	}
}